<?php
unset($_POST);
$_POST = $_REQUEST;
ini_set("max_execution_time",18000);
ini_set("display_errors",1);

//路径定义
define('IP','202.206.245.88:8081');
$loginurl = "http://".IP."/pyxx/login.aspx"; //登录页
$picurl = "http://".IP."/pyxx/PageTemplate/NsoftPage/yzm/createyzm.aspx"; //验证图片

$personurl = "http://".IP."/pyxx/grgl/xsinfoshow.aspx"; //个人信息
$photourl  = "http://".IP."/pyxx/grgl/photo.aspx"; //个人照片

$tableurl  = "http://".IP."/pyxx/pygl/pyxkcx.aspx"; //课表
$examurl   = ""; //考试
$scoreurl  = "http://".IP."/pyxx/grgl/xskccjcx.aspx"; //成绩

$agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36';//伪装浏览器

//include 登陆类
include("class/Snoopy.class.php");

//html解析类
include("class/simple_html_dom.php");

//配置session
$lifeTime = 2 * 3600;   
session_set_cookie_params($lifeTime);

//获取session
if(isset($_POST['token'])) session_id($_POST['token']);
session_start();

//统一返回
function json_res($error,$result,$message=""){
    header('Content-type: application/json');
    return json_encode(array('error' =>$error,'result'=>$result,'message' =>$message));
}

if(empty($_SESSION["__VIEWSTATE"]) && $path != "pre"){
	echo json_res(true,'tokenTimeOut',"请登录");
	exit;
}

